#ifndef __PLATFORM_LIB_SHA1_H__
#define __PLATFORM_LIB_SHA1_H__
#ifdef __cplusplus
extern "C"
{
#endif

#include "pf_common.h"

/******************************************************************************************************/

typedef struct pf_sha1 pf_sha1_t;

/*********************************************************************************************
Function Name:  pf_sha1_start
Description  :  init  pf_sha1
Inputs       :
Outputs      :  pf_sha1_t* : return the intial struct of the sha1,NULL for error
ErrorCodes   :  PF_ENOMEM       : intial sha1 struct error
History      :
---------------------------------------------------------------------------------------------
Author                 Date                          Comments
huyq                   2011-06-23                    create
**********************************************************************************************/
extern  pf_sha1_t* pf_sha1_start(void);
    

/*********************************************************************************************
Function Name:  pf_sha1_append
Description  :  append data to pf_sha1
Inputs       :  pf_sha1_t* sha1 : the context of the pf_sha1
                const void*     data : the buffer to haddle
                size_t          len  : the size of the buffer
Outputs      :  int                  : 0 for ok
ErrorCodes   :
History      :
---------------------------------------------------------------------------------------------
Author                 Date                          Comments
huyq                   2011-06-23                    create
**********************************************************************************************/
extern int pf_sha1_append(pf_sha1_t* sha1, const void* data, size_t len);

/*********************************************************************************************
Function Name:  pf_sha1_finish
Description  :  finish and get result
Inputs       :  pf_sha1_t* sha1     :the sha1 context
                unsigned char result[20] :the sha result
Outputs      :  int                      :0 for ok
ErrorCodes   :
History      :
---------------------------------------------------------------------------------------------
Author                 Date                          Comments
huyq                   2011-06-23                    create
**********************************************************************************************/
extern int pf_sha1_finish(pf_sha1_t* sha1, unsigned char result[20]);

/******************************************************************************************************/

#ifdef __cplusplus
}
#endif
#endif /* #ifndef __PLATFORM_LIB_SHA1_H__ */


